Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added multifile support #182

Merged
merged 13 commits into from
Apr 17, 2024
Merged

Added multifile support #182

merged 13 commits into from
Apr 17, 2024

Conversation

HPT-I
Copy link
Contributor

@HPT-I HPT-I commented Apr 12, 2024

Closes #132

@HPT-I HPT-I requested a review from Bliztle April 12, 2024 08:39
Copy link
Contributor

@TheMagzuz TheMagzuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fix build errors in tests ;)

@HPT-I HPT-I requested a review from TheMagzuz April 12, 2024 11:15
@Bliztle
Copy link
Contributor

Bliztle commented Apr 12, 2024

I think this is a big enough feature that we need immediate tests on it to ensure it actually works. If we had other work waiting for this to be approved i would do it now, but we might as well get it in before merging.

Copy link
Contributor

@Bliztle Bliztle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need tests

@HPT-I
Copy link
Contributor Author

HPT-I commented Apr 15, 2024

The split file tests cannot be run asynchronously because the generated code may match in content but differ in order. This results in the verified files causing an error.

@HPT-I HPT-I dismissed stale reviews from Bliztle and TheMagzuz April 15, 2024 11:35

done

Comment on lines 83 to 84
// Reset the parser to be able to type check the file later.
parsers[file].Reset();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to reset the parser here.
Visitors act on the tree after parsing has happened.

Comment on lines 118 to 119
// Reset the parser because its good practice.
parsers[file].Reset();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do however need to reset the parser here, since the translator is a listener, so it runs while the parse tree is being generated.

Comment on lines +28 to +33
// RunFiles is run for each file, and passing files to CompileSct only passes the file that triggered the test.
// This method is used to get all files to pass to CompileSct.
private static string[] GetFiles()
{
return Files.SelectMany(f => f).ToArray();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now we generate two identical snapshots. Wouldn't it be better to just remove the dynamic stuff from this test so it functions as a single test case instead of two?
All that needs to be done is to remove the files argument.

@TheMagzuz TheMagzuz merged commit 4b86480 into main Apr 17, 2024
2 checks passed
@TheMagzuz TheMagzuz deleted the importing branch April 17, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Code) Import other files
3 participants